package shiro.authc.common;

public class JsonResult
{
	private boolean success;

	private String status;

	private String msg;

	private Object obj;

	public static JsonResult success()
	{
		JsonResult result = new JsonResult();
		result.setSuccess(true);
		return result;
	}

	public static JsonResult success(Object data)
	{
		JsonResult jsonResult = new JsonResult();
		jsonResult.setSuccess(true);
		jsonResult.setObj(data);
		return jsonResult;
	}

	public static JsonResult failure(String msg)
	{
		JsonResult result = new JsonResult();
		result.setSuccess(false);
		result.setMsg(msg);
		return result;
	}

	public static JsonResult failure()
	{
		JsonResult result = new JsonResult();
		result.setSuccess(false);
		return result;
	}

	public static JsonResult unknown(boolean isSuccess)
	{
		JsonResult result = new JsonResult();
		result.setSuccess(isSuccess);
		return result;
	}

	public boolean isSuccess()
	{
		return success;
	}

	public void setSuccess(boolean success)
	{
		this.success = success;
	}

	public String getStatus()
	{
		return status;
	}

	public void setStatus(String status)
	{
		this.status = status;
	}

	public String getMsg()
	{
		return msg;
	}

	public void setMsg(String msg)
	{
		this.msg = msg;
	}

	public Object getObj()
	{
		return obj;
	}

	public void setObj(Object obj)
	{
		this.obj = obj;
	}
}
